package com.jieshuibao.service;

import java.util.List;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;

import com.jieshuibao.mapper.TvboxMapper;
import com.jieshuibao.model.db.Tvbox;
import com.jieshuibao.model.db.TvboxExample;

@Service
public class TvboxService{
	
	@Resource
	private TvboxMapper tvboxMapper;
	
	public void addTvbox(Tvbox tvbox) {
		tvboxMapper.insertSelective(tvbox);
	}
	
	public void delTvboxByDeviceNo(String deviceNo) {
		tvboxMapper.deleteByPrimaryKey(deviceNo);
	}
	
	public void updateTvbox(Tvbox tvbox) {
		tvboxMapper.updateByPrimaryKeySelective(tvbox);
	}
	
	public void updateTvboxByExample(Tvbox tvbox,TvboxExample tvboxExample){
	    tvboxMapper.updateByExampleSelective(tvbox,tvboxExample);
	}
	
	public Tvbox getTvboxByDeviceNo(String deviceNo) {
		return tvboxMapper.selectByPrimaryKey(deviceNo);
	}
	
	public List<Tvbox> getPageTvbox(TvboxExample tvboxExample) {
		return tvboxMapper.selectPage(tvboxExample);
	}
	
	public int countTvbox(TvboxExample tvboxExample) {
		return tvboxMapper.countByExample(tvboxExample);
	}
	
	public List<Tvbox> selectByExample(TvboxExample example){
	    return tvboxMapper.selectByExample(example);
	}
}
